import json

# 读取config.json文件
with open("./config.json", "r") as config_file:
    config_data = json.load(config_file)

# 访问配置信息
pattern = config_data["pattern"]
suffix = config_data["suffix"]
encoding = config_data["encoding"]

if suffix == "" :
    suffix = ".log"

def read_config():
    return config_data

def save_config(config_data):
    with open('config.json', 'w') as f:
        json.dump(config_data, f, indent=4)